package cn.lysj.framework.order.repository;

import cn.lysj.framework.base.BaseRepository;
import cn.lysj.framework.order.domain.FoodOrderInfo;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zwj
 * @description 订单食物详情数据处理层
 * @create 2018-11-05 10:30:21
 **/
public interface FoodOrderInfoRepository extends BaseRepository<FoodOrderInfo> {

    @Query(value = "select new cn.lysj.framework.order.domain.FoodOrderInfo(a.foodOrderId, a.foodId, a.foodName, a.money, a.number, a.status, a.foodTypeId, a.standardLevTwoIds, a.standardLevTwoIdNames,b.priority) from FoodOrderInfo a ,FoodType b where a.foodTypeId = b.id and a.foodOrderId = ?1 order by b.priority asc ")
    List<FoodOrderInfo> findFoodOrderInfoList(String foodOrderId);

    List<FoodOrderInfo> findByFoodOrderId(String foodOrderId);

}